package com.example.demo.lambda;

/**
 * <pre>
 *  描述:
 * </pre>
 *
 * @author godelgnis(wujiaer)
 * @version 1.0.0
 * @date 2022/4/25 15:36
 */
public class FunctionTest {


    public static void main(String[] args) {
        doAction(()->FunctionTest.printAndReturn());
    }

    private static String printAndReturn() {
        System.out.println("ha ha");
        return "he he";
    }

    private static void printHelloWorld() {
        System.out.println("hello world");
    }

    private static void doAction(Action action) {
        System.out.println("action start");
        action.doSomething();
        System.out.println("action end");
    }


    @FunctionalInterface
    interface Action{
        void doSomething();
    }


}
